package qc.module.platform.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.platform.dto.log.ApiLogDetailDto;
import qc.module.platform.entity.QcApiLogs;

/**
 * ApiLogDetailMapper
 *
 * @author QuCheng Tech
 * @create 2023/02/06
 */
@Mapper
public interface ApiLogDetailMapper {
    ApiLogDetailMapper MAPPER = Mappers.getMapper(ApiLogDetailMapper.class);

    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd HH:mm:ss.SSS")
    @Mapping(target = "ip", source = "host")//数据库表中的列名为host，DTO中统一为ip
    ApiLogDetailDto toDto(QcApiLogs en);
}
